package com.tianxiao.faas.application.web.corner;

import com.tianxiao.faas.api.param.corner.SearchHotResult;
import com.tianxiao.faas.biz.service.corner.SearchHotService;
import com.tianxiao.faas.common.access.Access;
import com.tianxiao.faas.common.result.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/app/search/hot")
public class SearchHotController {

    @Resource
    private SearchHotService searchHotService;


    @RequestMapping(value = "/list")
    @Access
    public Result<List<SearchHotResult>> list(Integer type) {
        Integer count = 15;
        List<SearchHotResult> results = searchHotService.list(type, count);
        return Result.builder().success(true).data(results);
    }
}
